package com.bm.application;

import com.bm.mapper.WordMapper;
import com.bm.pojo.Word;
import com.bm.utils.ExcelReader;
import com.bm.utils.SqlSessionUtil;
import org.apache.ibatis.session.SqlSession;

import java.util.List;

public class BampleMain {
    public static void main(String[] args) {
        //1.插入
        //String filePath = "Bample/src/main/resources/wordfiles/王陆雅思词汇.xlsx";
        //List<Word> words = ExcelReader.readExcel(filePath);
        //SqlSession sqlSession = SqlSessionUtil.getSqlSession();
        //WordMapper mapper = sqlSession.getMapper(WordMapper.class);
        //for(Word word: words){
        //    mapper.insertWord(word);
        //    sqlSession.commit();
        //}
        //SqlSessionUtil.closeSqlSession(sqlSession);

        //2.查询
        //SqlSession sqlSession = SqlSessionUtil.getSqlSession();
        //WordMapper mapper = sqlSession.getMapper(WordMapper.class);
        //List<Word> words = mapper.selectWords();
        //for (Word word : words) {
        //    System.out.println(word);
        //}
    }


}
